package com.g001.enums;


public enum BlockState {
	
	IDLE(0),
	FALL(1),
	SWITCH(2),
	SWITCH_BACK(3),
	EXPLOSE(4),
	REMOVE(5),
	DESTROY(6),
	SHOCK(7),
	SELECTED(8),
	;
	
	 
	private int id;
	
	private BlockState(final int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}
	
	public static BlockState getBlockState(final int id) {
		switch(id) {
			case 0 : return IDLE;
			case 1 : return FALL;
			case 2 : return SWITCH;
			case 3 : return SWITCH_BACK;
			case 4 : return EXPLOSE;
			case 5 : return REMOVE;
			case 6 : return DESTROY;
			case 7 : return SHOCK;
			case 8 : return SELECTED;
			default :throw new IllegalArgumentException("no id ("+id+") affected to any Block state");
		}
	}

}
